package com.lx.patterns.interpreter;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName Context
 * @Description: //todo
 * @Author: 落雪
 * @CreateDate: 2025/2/15 16:17
 * @UpdateUser: 落雪
 * @UpdateDate: 2025/2/15 16:17
 * @UpdateRemark:
 * @Version: 1.0
 */
public class Context {

    private Map<Variable, Integer> map = new HashMap<Variable, Integer>();


    public void assign(Variable var, Integer value) {
        map.put(var, value);
    }

    public int getValue(Variable var) {
        Integer value = map.get(var);
        return value;
    }

}
